<template>
  <el-container class="index-con">
    <el-aside :class="showClass">
      <leftnav></leftnav>
    </el-aside>
    <el-container class="main-con">
      <el-header class="index-header">
        <navcon></navcon>
      </el-header>
      <el-main class="index-main">
        <router-view class="main_box"></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
import leftnav from "../components/leftnav";
import navcon from "../components/navcon";
export default {
  name: "backHome",
  components: {
    leftnav,
    navcon
  },
  data() {
    return{
      showClass: 'aside_show',
      showType: false
    }
  },
  methods: {

  },
  created() {
    //监听侧边栏收放
    this.$root.Bus.$on('toggle',value =>{
      if(value) {
        this.showClass = 'aside_show';
      } else {
        setTimeout(() => {
          this.showClass = 'aside';
        },300);
      }
    });
  }
}
</script>

<style scoped>
.index-con {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.aside {
  width: 64px !important;
  height: 100%;
  background-color: #063864; /*#334157*/
  margin: 0;
  /*box-shadow : 0 10px 31px rgba(0, 0, 0, 0.44) ;*/
}
.aside_show {
  /*box-shadow : 0 10px 31px rgba(0, 0, 0, 0.44) ;*/
  width: 265px !important;
  height: 100%;
  background-color: #063864;
  margin: 0px;
}
.index-header,
.index-main {
  padding: 0px;
  border-left: 2px solid #333;
  background-color: #faf7f7;

}
.main_box{
  margin: 30px 40px;
}
</style>
